package com.cn.admin.utils;

import org.springframework.beans.factory.annotation.Autowired;

import java.io.Serializable;
import java.util.List;

public class BaseServiceImpl<T,T1, ID extends Serializable> implements  BaseService<T,T1,ID>{

    @Autowired
    private MyMapper<T> myMapper;//泛型装配


    @Override
    public int countByExample(T1 example) {
        return myMapper.selectCountByExample(example);
    }

    @Override
    public int deleteByPrimaryKey(ID id) {
        return myMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int deleteByExample(T1 example) {
        return myMapper.deleteByExample(example);
    }

    @Override
    public int insert(T record) {
        return myMapper.insert(record);
    }

    @Override
    public int insertSelective(T record) {
        return myMapper.insertSelective(record);
    }

    @Override
    public T selectByPrimaryKey(ID id) {
        return myMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<T> selectByExample(T1 example) {
        return myMapper.selectByExample(example);
    }

    @Override
    public int updateByPrimaryKeySelective(T record) {
        return myMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByExampleSelective(T record) {
        return myMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(T record) {
        return myMapper.updateByPrimaryKey(record);
    }
    @Override
    public int updateByExample(T record,T1 example) {
        return myMapper.updateByExample(record,example);
    }
}
